package com.biz.primus.app.erpbridge.controller;

import com.biz.primus.app.erpbridge.feign.ProductFeignClient;
import com.biz.primus.base.support.rest.vo.JsonResult;
import com.biz.primus.product.vo.ErpProductRecVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author jiangnan
 * @Description:
 */
@RestController
@RequestMapping("bridge/product")
public class ProductBridgeController extends BaseBridgeController{

    private final ProductFeignClient productFeignClient;

    public ProductBridgeController(ProductFeignClient productFeignClient) {
        this.productFeignClient = productFeignClient;
    }

    @GetMapping
    @ApiOperation(value = "erp获取推荐商品接口",response = ErpProductRecVo.class)
    JsonResult recommend(@RequestParam("userId") Long userId, @RequestParam("depotCode") String depotCode){
        List<ErpProductRecVo> recommend = productFeignClient.recommend(userId, depotCode);
        return new JsonResult(recommend);
    }

}
